import datetime
from django.template import loader, Context
from django.core.mail import send_mail, mail_admins, BadHeaderError
import settings


## TO BE MOVED ## ## this is clicktospeak stuff

## this function send mail 1 in registration step
def getMailNotification(post_data):
    return


def mailErrorNotification(errMsg):
    from settings import MAIL_WARNINGS 
    mailData = {
        'from': settings.DEFAULT_FROM_EMAIL,
        'to':[MAIL_WARNINGS,],
        'subject': '[WARNING] errore CMS',
        'text': 'modulo:%s\n errore:%s\n' % (errMsg['origin'], errMsg['error'])
    }
    mail_admins ( mailData['subject'], 
                mailData['text'], fail_silently=not settings.DEBUG )
    return

def sendExpiringCreditNotification():
    return
